home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH7 / SRC / OBJ1ARC.CLS < prev    next >
Encoding:
Text File  |  1995-10-26  |  1.5 KB  |  56 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "ObjArc"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. Public x As Single
  11. Public y As Single
  12. Public r As Single
  13. Public angle1 As Single
  14. Public angle2 As Single
  15. Public aspect As Single
  16.  
  17. Function ObjectType() As String
  18.     ObjectType = "ARC"
  19. End Function
  20.  
  21. ' ************************************************
  22. ' Compute the world coordinate bounds for the
  23. ' arc.
  24. ' ************************************************
  25. Sub Bound(xmin As Single, ymin As Single, xmax As Single, ymax As Single)
  26. '@
  27.     xmin = x - r
  28.     xmax = x + r
  29.     ymin = y - r
  30.     ymax = y + r
  31. End Sub
  32.  
  33. ' ************************************************
  34. ' Write an arc to a file using Write.
  35. ' Begin with "ARC" to identify this object.
  36. ' ************************************************
  37. Sub FileWrite(filenum As Integer)
  38.     Write #filenum, "ARC", x, y, r, angle1, angle2, aspect
  39. End Sub
  40. ' ************************************************
  41. ' Draw the arc on a Form, Printer, or
  42. ' PictureBox.
  43. ' ************************************************
  44. Sub Draw(canvas As Object)
  45.     canvas.Circle (x, y), r, , angle1, angle2, aspect
  46. End Sub
  47.  
  48. ' ************************************************
  49. ' Read an arc from a file using Input.
  50. ' Assume the "ARC" label has already been read.
  51. ' ************************************************
  52. Sub FileInput(filenum As Integer)
  53.     Input #filenum, x, y, r, angle1, angle2, aspect
  54. End Sub
  55.  
  56.